package com.wits.qso.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import net.sf.json.JSONObject;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.wits.platform.entity.BaseEntity;

@Entity
@Table(name="qso_signin")
public class SignIn extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**记录代码*/
	private String id;
	/**排课代码*/
	private String ttablehid;
	/**学生代码*/
	private String userid;
	/***课程代码*/
	private String courseid;

	@Id
	@GenericGenerator(name = "idGen", 
					strategy = "com.wits.platform.common.id.generator.IDGenerator",
					parameters={ 
								@Parameter(name = "segment_value", value = "QSO_SIN_ID"), 
								@Parameter(name="table_name",value="wits_id_generator"),
								@Parameter(name="value_column_name",value="gen_value"),
								@Parameter(name="segment_column_name",value="gen_name"),
								@Parameter(name="segment_value_length",value="10"),
								@Parameter(name="sq_format",value="%08d"), 
								@Parameter(name="sq_prefix",value="SI") 
					})
	@GeneratedValue(generator = "idGen")
	@Column(name = "sin_id", nullable = false, insertable = true, updatable = false, length = 10)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "ttableh_id" , length = 10)
	public String getTtablehid() {
		return ttablehid;
	}

	public void setTtablehid(String ttablehid) {
		this.ttablehid = ttablehid;
	}

	@Column(name = "user_id" , length = 20)
	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	@Column(name = "course_id" , length = 20)
	public String getCourseid() {
		return courseid;
	}

	public void setCourseid(String courseid) {
		this.courseid = courseid;
	}

	@Override
	public String display() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toString() {
		return JSONObject.fromObject(this, SignIn.getBaseJsonConfig())
				.toString();
	}

}
